/**
 * 发证操作的js api
 */
import request from "@/utils/request";

/**
 * 查询取件人的证件类型
 */
export function initSysDictData() {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/tyfz/caseCertificationInfo/initSysDictData",
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

/**
 * 保存发证的数据
 * @param {*} data
 */
export function saveUpdate(data) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/tyfz/caseCertificationInfo/saveOrUpdate",
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}

/**
 * 根据办件编号查询
 * @param {*} caseNumber
 */
export function queryOnlyByCaseNumber(caseNumber) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/tyfz/caseSignFor/queryOnlyByCaseNumber/${caseNumber}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

export function getCertificationByCsfOid(csfOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/tyfz/caseCertificationInfo/getCertificationByCsfOid?csfOid=" +
      csfOid,
    method: "get"
  });
}
